Linux webm002.cluster126.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
/
home
/
ariannadhf
/
www
/
wp-content
/
plugins
/
themeisle-companion
/
dashboard
/
src
/
utils
/
/home/ariannadhf/www/wp-content/plugins/themeisle-companion/dashboard/src/utils/common.js
import { post } from "./rest"; import { __ } from "@wordpress/i18n"; export const tabs = { modules: __("Available Modules", "themeisle-companion"), plugins: __("Recommended Plugins", "themeisle-companion"), }; export const getTabHash = () => { let hash = window.location.hash; if ("string" !== typeof window.location.hash) { return null; } hash = hash.substring(1); if (!Object.keys(tabs).includes(hash)) { return null; } return hash; }; export const unregister = (url) => { post(url, "deactivate=unregister").then((r) => { if (r === false) { return; } window.location.reload(); }); }; /** * Decodes a html encoded string while preserving tags * * @param {string} html encoded string * @return {string} decoded string */ export const decodeHtml = (html) => { const txt = document.createElement("textarea"); txt.innerHTML = html; return txt.value; };